const fs = require('fs-extra');

function isEmptyFolder(folder) {
  try {
    // 同步判断当前目录是否为空
    return fs.readdirSync(folder).length === 0;
  } catch (error) {
    // 判为不存在
    return true;
  }
}

function gitDownloadURIGen(type, repo) {
  let uri = ''
  switch (type) {
    case 'account':
      uri = ``
      break;
    case 'ssh':
      uri = ``
      break
    default:
      break;
  }
  return uri
}

function drawSplit(title = 'split here') {
  title ?
    console.log(`------------------${title}------------------`) :
    console.log('------------------------------------');
}

module.exports = {
  drawSplit,
  isEmptyFolder,
  gitDownloadURIGen
}